<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>vertical-align</title>
<meta name="description" content="CSS3参考手册之:vertical-align" />
<meta name="keywords" content="vertical-align, css3, css3参考手册" />
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<meta name="robots" content="all" />
<!--[if lte IE 8]>
<script src="../../js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../skin/article.css" />
</head>
<body>
<nav id="guide" class="g-mod">
	<div class="from">
		<a href="http://css.doyoe.com/" target="_blank">CSS3参考手册</a>
		<span>&#187;</span>
		<a href="../index.htm">属性列表</a>
		<span>&#187;</span>
		<a href="index.htm" id="category" rel="properties/text" name="vertical-align">文本属性</a>
		<span>&#187;</span>
	</div>
	<div class="to">
		<span class="label">相关内容：</span>
		<div class="g-combobox g-transition">
			<a href="?" class="g-transition target">
				<strong>其它文本属性参考</strong>
				<span>选择其它项<!--[if lte IE 7]><ins>IE7 and earlier, Get to die</ins><![endif]--></span>
			</a>
			<div class="g-transition list">
				<ul>
					<!-- 插入快速分类导航 -->
				</ul>
			</div>
		</div>
	</div>
</nav>
<header id="hd">
	<section id="title" class="g-mod">
		<h1 class="tit">vertical-align</h1>
		<ul class="info">
			<li><strong>版本：CSS1/2</strong></li>
			<li>2018.4.8</li>
		</ul>
		<!-- 插入浏览器信息 -->
	</section>
</header>
<section id="bd">
	<section id="syntax" class="g-mod g-attr">
		<h2 class="tit">语法：</h2>
		<div class="cont">
			<p><strong>vertical-align</strong>：baseline | sub | super | top | text-top | middle | bottom | text-bottom | <a href="../../values/numeric/percentage.htm">&lt;percentage&gt;</a> | <a href="../../values/length/length.htm">&lt;length&gt;</a></p>
			<p><strong>默认值</strong>：<mark class="defaultvalue">baseline</mark></p>
			<p><strong>适用于</strong>：内联级与 table-cell 元素</p>
			<p><strong>继承性</strong>：无</p>
			<p><strong>动画性</strong>：当值为 <a href="../../values/length/length.htm">&lt;length&gt;</a> 时</p>
			<p><strong>计算值</strong>：指定值</p>
			<p><strong>媒　体</strong>：视觉</p>
		</div>
	</section>
	<section id="value" class="g-mod g-attr">
		<h2 class="tit">取值：</h2>
		<div class="cont">
			<dl>
				<dt>baseline：</dt>
				<dd>把当前盒的基线与父级盒的基线对齐。如果该盒没有基线，就将底部外边距的边界和父级的基线对齐</dd>
				<dt>sub：</dt>
				<dd>把当前盒的基线降低到合适的位置作为父级盒的下标（该值不影响该元素文本的字体大小）</dd>
				<dt>super：</dt>
				<dd>把当前盒的基线提升到合适的位置作为父级盒的上标（该值不影响该元素文本的字体大小）</dd>
				<dt>text-top：</dt>
				<dd>把当前盒的top和父级的内容区的top对齐</dd>
				<dt>text-bottom：</dt>
				<dd>把当前盒的bottom和父级的内容区的bottom对齐</dd>
				<dt>middle：</dt>
				<dd>把当前盒的垂直中心和父级盒的基线加上父级的半x-height对齐</dd>
				<dt>top：</dt>
				<dd>把当前盒的top与行盒的top对齐</dd>
				<dt>bottom：</dt>
				<dd>把当前盒的bottom与行盒的bottom对齐</dd>
				<dt><a href="../../values/numeric/percentage.htm">&lt;percentage&gt;</a>：</dt>
				<dd>把当前盒提升（正值）或者降低（负值）这个距离，百分比相对line-height计算。当值为0%时等同于baseline。</dd>
				<dt><a href="../../values/length/length.htm">&lt;length&gt;</a>：</dt>
				<dd>把当前盒提升（正值）或者降低（负值）这个距离。当值为0时等同于baseline。（CSS2）</dd>
			</dl>
		</div>
	</section>
	<section id="intro" class="g-mod g-attr">
		<h2 class="tit">说明：</h2>
		<div class="cont">
			<strong>定义行内元素在行框内的垂直对齐方式。</strong>
			<ul>
				<li>对应的脚本特性为：<strong>verticalAlign</strong>。</li>
			</ul>
		</div>
	</section>
	<section id="compatible" class="g-mod g-attr">
		<h2 class="tit">兼容性：</h2>
		<div class="cont">
			<ul class="support-type">
				<li><span class="support">浅绿</span> = 支持</li>
				<li><span class="unsupport">红色</span> = 不支持</li>
				<li><span class="partsupport">粉色</span> = 部分支持</li>
			</ul>
			<table class="g-data">
				<thead>
					<tr>
						<th>Values</th>
						<th>IE</th>
						<th>Firefox</th>
						<th>Chrome</th>
						<th>Safari</th>
						<th>Opera</th>
						<th>iOS Safari</th>
						<th>Android Browser</th>
						<th>Android Chrome</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><strong>Basic Support</strong></td>
						<td class="support">8.0+</td>
						<td class="support">40.0+</td>
						<td class="support">40.0+</td>
						<td class="support">8.0+</td>
						<td class="support">40.0+</td>
						<td class="support">8.0+</td>
						<td class="support">4.4+</td>
						<td class="support">28.0+</td>
					</tr>
				</tbody>
			</table>
		</div>
	</section>
	<section id="example" class="g-mod g-attr">
		<h2 class="tit">示例：</h2>
		<div class="cont">
			<textarea cols="90" rows="10">
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>vertical-align_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
.test p{border:1px solid #000;font-size:16px;line-height:2;}
.test a{margin-left:5px;font-size:12px;}
.baseline a{vertical-align:baseline;}
.sub a{vertical-align:sub;}
.super a{vertical-align:super;}
.top a{vertical-align:top;}
.text-top a{vertical-align:text-top;}
.middle a{vertical-align:middle;}
.bottom a{vertical-align:bottom;}
.text-bottom a{vertical-align:text-bottom;}
.length a{vertical-align:10px;}
</style>
</head>
<body>
<ul class="test">
	<li class="baseline">
		<strong>与基线对齐</strong>
		<p>参考内容<a href="?">基线对齐</a></p>
	</li>
	<li class="sub">
		<strong>与参考内容的下标对齐</strong>
		<p>参考内容<a href="?">下标对齐</a></p>
	</li>
	<li class="super">
		<strong>与参考内容的上标对齐</strong>
		<p>参考内容<a href="?">上标对齐</a></p>
	</li>
	<li class="top">
		<strong>对象的内容与对象顶端对齐</strong>
		<p>参考内容<a href="?">要对齐的内容</a></p>
	</li>
	<li class="text-top">
		<strong>对象的文本与对象顶端对齐</strong>
		<p>参考内容<a href="?">要对齐的内容</a></p>
	</li>
	<li class="middle">
		<strong>对象的内容与对象中部对齐</strong>
		<p>参考内容<a href="?">要对齐的内容</a></p>
	</li>
	<li class="bottom">
		<strong>对象的内容与对象底端对齐</strong>
		<p>参考内容<a href="?">要对齐的内容</a></p>
	</li>
	<li class="text-bottom">
		<strong>对象的文本与对象顶端对齐</strong>
		<p>参考内容<a href="?">要对齐的内容</a></p>
	</li>
	<li class="length">
		<strong>与基线算起的偏移量</strong>
		<p>参考内容<a href="?">偏移量对齐</a></p>
	</li>
</ul>
</body>
</html>
			</textarea>
			<p><input type="button" value="运行" class="g-btn g-btn-sure" /></p>
		</div>
	</section>
</section>
<footer id="ft">
	<aside id="rights" class="g-mod">
		<!-- 插入浏览器及版权信息 -->
	</aside>
</footer>
<script src="../../js/jquery.js"></script>
<script src="../../js/inner.js"></script>
</body>
</html>